#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
struct moonCake{
	double total_dose;
	double total_price;
	double price;
};
vector<moonCake> M;
bool Cmp(const moonCake &x,const moonCake &y){
	return x.price>y.price;
}
double data1[2][1010];
int main(){
	freopen("input.txt","r",stdin);
	int n;
	double d;
	cin>>n>>d;
	for(int i=0;i<2;i++){
		for(int j=0;j<n;j++){
			cin>>data1[i][j];
		}
	}
	for(int i=0;i<n;i++){
		moonCake M1;
		M1.total_dose=data1[0][i];
		M1.total_price=data1[1][i];
		M1.price=(double)M1.total_price/M1.total_dose;
		M.push_back(M1);
	}
	sort(M.begin(),M.end(),Cmp);
	double s;
	for(int i=0;i<n;i++){
		double temp=d;
		d-=min(d,M[i].total_dose);
		s+=(temp-d)*M[i].price;
	}
	printf("%.2f",s);

}